/**
 * http://code.google.com/p/x-updater/
 */
package org.charry.xupdater.configgen;

import java.io.File;
import java.util.Comparator;

/**
 * 
 * @author WangHui
 *
 */
public class FileComparator implements Comparator<File>{

	@Override
	public int compare(File arg0, File arg1) {
		// sort file by last modified time, in descending order
		if (arg0.lastModified() == arg1.lastModified()) {
			return 0;
		} else if (arg0.lastModified() > arg1.lastModified()) {
			return -1;
		} else
			return 1;
	}
}
